<template>
	<view>
		
		<u-button @click="handleOpen">打开文件</u-button>
		
		
	</view>
</template>

<script setup>
	
	
	
	function handleOpen () {
		uni.downloadFile({
		  url: 'http://10.42.42.60:9000/tobacco/2024/06/14/40d63c7d48e5_20240614165427A002.xlsx',
		  success: function (res) {
		    var filePath = res.tempFilePath;
		    uni.openDocument({
		      filePath: filePath,
		      showMenu: true,
		      success: function (res) {
		        console.log('打开文档成功');
		      }
		    });
		  }
		});

		
		
	}
</script>

<style>
	       
</style>
